package com.chuangjiangx.member.coupon.ddd.domain.model;

/**
 * 支付即会员 微信状态
 *
 * @author wp
 * @date 2018-08-28 15:10
 **/
public enum MbrPayGiftCardWxStatusEnum {
    SETED("已设置",1),
    UNSET("未设置",0)
    ;

    public String name;
    public Integer code;

    MbrPayGiftCardWxStatusEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static MbrPayGiftCardWxStatusEnum fromCode(Integer code){
        for(MbrPayGiftCardWxStatusEnum swicthEnum: MbrPayGiftCardWxStatusEnum.values()){
            if(code.equals(swicthEnum.code)){
                return swicthEnum;
            }
        }
        throw new IllegalStateException("不存在 该选项:  "+code);
    }
}
